<script>
$(function(){
});
</script>
<div class="t_2">
     <div class="fl">发票列表</div>
     <div class="fr add_form"><a href="javascript:;" id="add_table"></a></div>
</div>
<div class="order_show" id="info_form">
     <table width="100%" cellpadding="0" cellspacing="0" border="0" class="table1">
            <tr>
                <th width="15%" class="th0">名称</td>
                <!--<th width="35%" class="th0">抬头</td>-->
                <th width="15%" class="th0">内容</td>
                <th width="35%" class="th0">操作</td>
            </tr>			
			<?php foreach((array)$this->rows as $item): ?>
			<tr>
				<td><?=$item['name']?></td>
				<!--<td><?=$item['tt']?></td>-->
				<td><?=$item['nr']?></td>
				<td><a href="javascript:;" rel="del" label="<?=$item['fid']?>">删除</a> | <a href="javascript:;" onclick="window.location.href='<?=$_SERVER['REQUEST_URI']?>&act=modi&fid=<?=$item['fid']?>'">修改</a></td>
			</tr>
			<?php endforeach; ?>
     </table>
</div>
<div class="line_1"></div>
<div class="t_2">
     <div class="fl">添加发票信息</div>
     <div class="fr add_form"><a href="javascript:;" id="add_table"></a></div>
</div>
<div class="order_show" id="info_form">
     <form id="post_form">
     <table width="100%" cellpadding="0" cellspacing="0" border="0" class="info_table">
            <tr>
                <td class="td1" width="15%">名称：</td>
                <td><input type="text" name="name" /></td>
            </tr>
            <!--<tr>
                <td class="td1" width="15%">抬头：</td>
                <td><input type="text" name="tt" /></td>
            </tr>-->
            <tr>
                <td class="td1" width="15%">内容：</td>
                <td><input type="text" name="nr" /></td>
            </tr>
            <tr>
                <td class="td1" colspan="2" style="text-align:center">
					<input type="submit" value="提交" />
					<input type="hidden" name="act" value="add"/>
				</td>
            </tr>
	</table>
	</form>
</div>
<script>
$(function(){
	$('#post_form').submit(function(){
		$.post(location.href,$(this).serialize(),function(data){
			alert(data.message);
			if (data.state == 1)
			{
				window.location.reload();
			}
		},'json');
		return false;
	});
	$('a[rel=del]').click(function(){
		if (confirm('确定删除？'))
		{
			var fid = $(this).attr('label');

			$.post(location.href,{act:'del',fid:fid},function(data){
				alert(data.message);
				if (data.state == 1)
				{
					window.location.reload();
				}
			},'json');
		}
	});
});
</script>
     